//*********************************************************************
//  FoodItem.java   Author: Lewis/Loftus
//
//  Represents an item of food. Used as the parent of a derived class
//  to demonstrates indirect referencing.
//*********************************************************************

@SuppressWarnings({"EmptyMethod", "ConstantConditions"})
public class FoodItem
{
    final private int  CALORIES_PER_GAME = 9;
    private int fatGame;
    protected int servings ;

    //-----------------------------------------------------------------
    //  Sets up this food item with the specified number of fat grams
    //  and number of servings.
    //-----------------------------------------------------------------
    public FoodItem(int numFatGames, int numServings)
    {
        fatGame = numFatGames;
        servings = numServings;
    }

    //-----------------------------------------------------------------
    //  Computes and returns the number of fat calories per serving.
    //-----------------------------------------------------------------
    private int calories()
    {
        return fatGame * CALORIES_PER_GAME;
    }

    //-----------------------------------------------------------------
    //  Computes and returns the number of fat calories per serving.
    //-----------------------------------------------------------------
    public int caloriesPerServing()
    {
        return (calories()/servings);
    }
}
